package com.education.platform.management.controller.common;


import com.education.platform.common.qiniu.QiNiuService;
import com.education.platform.management.vo.response.QiNiuResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

/**
* describe:
* @author : tomato
* @date: 2020-06-07 11:38:44.106
**/
@RestController
@Api("文件")
@RequestMapping("file")
@Validated
public class FileController {
	
    private static final Logger LOGGER = LoggerFactory.getLogger(FileController.class);


  @Autowired
  private QiNiuService qiNiuService;

    /**
     * 获取上传链接
     *
     * @param
     * @return
     */
    @ApiOperation(value = "获取上传文件token")
    @GetMapping("getUploadToken")
    public QiNiuResponseVO getUploadUrl() {
        String url= qiNiuService.getUploadToken();
        QiNiuResponseVO responseVO = new QiNiuResponseVO();
        responseVO.setUploadToken(url);
        return responseVO;
    }



}
